package com.hxkj.domain.enums;

import com.platform.common.domain.exception.CustomExceptionCode;

/**
 * @EnumName TagsClassifyExceptionEnum
 * @Description TODO
 * @Author Mr.zheng
 * @Date 2018/6/7 11:44
 * @Version 1.0
 */
public enum TagsClassifyExceptionEnum implements CustomExceptionCode {
    TAGS_CLASSIFY_IS_EXIST(300, "名称已存在", 900),
    TAGS_CLASSIFY_NOT_EXIST(301, "名称不存在", 900),
    TAGS_CLASSIFY_SAVE_ERROE(302, "添加标签分类失败", 900),
    TAGS_CLASSIFY_DELETE_ERROE(303,"删除标签分类失败",900),
    TAGS_CLASSIFY_UPDATE_ERROE(304,"修改标签分类失败",900),
    TAGS_CLASSIFY_NOT_VOID(305,"标签分类信息不能为空",900),
    TAGS_CLASSIFY_NOT_NAME(306,"标签分类名称不能为空",900),
    TAGS_CLASSIFY_NOT_SITEID(307,"站点ID为空",900),
    ;
    private Integer code;
    private String msg;
    private Integer httpCode;

    TagsClassifyExceptionEnum(Integer code, String msg, Integer httpCode) {
        this.code = code;
        this.msg = msg;
        this.httpCode = httpCode;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    @Override
    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public Integer getHttpCode() {
        return httpCode;
    }

    @Override
    public void setHttpCode(Integer httpCode) {
        this.httpCode = httpCode;
    }

    public static TagsClassifyExceptionEnum getEnumByCode(Integer code){
        for(TagsClassifyExceptionEnum tagsClassifyExceptionEnum : TagsClassifyExceptionEnum.values()){
            if(code.equals(tagsClassifyExceptionEnum.getCode())){
                return tagsClassifyExceptionEnum;
            }
        }
        return null;
    }
}
